import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;

import edu.jhu.tcj.purfuit.Game;


public class IncorrectPanel extends GamePanel {
	
	private Game thisGame = null;
	private Application application = null;
	private Image img;
	
	public IncorrectPanel(Application application){
		this.application = application;
		ImageIcon imageIcon = new ImageIcon(getClass().getResource("images/sadey.png"));
		img = imageIcon.getImage();
	}
	
	@Override
	public void mouseClicked(MouseEvent e) {
		application.showGameBoardPanel(thisGame);
	}
	
	@Override
	public void keyPressed(KeyEvent ke) {
		application.showGameBoardPanel(thisGame);
	}
	
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		g.setColor(Color.red);
		g.fillRoundRect(0, 0, 800, 550, 80, 80);
		g.setColor(Color.black);
		g.setFont(new Font("Tahoma", Font.BOLD, 40));
		g.drawString("Sorry, that is the incorrect answer.", 60, 212);
		g.drawString("Your turn is now over.", 200, 280);
		g.drawImage(img, getWidth()/2-img.getWidth(null)/2, getHeight()-img.getHeight(null)-50, null);
	}
	
	public void setGame(Game game) {
		thisGame = game;
	}
}
